import { createRouter, createWebHistory } from "vue-router";
import LoginView from "../views/LoginView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "登录界面",
      component: LoginView,
    },
    {
      path: "/indexPage",
      name: "整体框架页面",
      component: () => import("./../views/IndexView.vue"),
      children: [
        {
          name: "首页",
          path: "/HomePage",
          component: () => import("../views/home/index.vue"),
        },
        {
          name: "设备列表",
          path: "/devicePage",
          component: () => import("../views/device/deviceList.vue"),
        },
        {
          name: "设备类型",
          path: "/deviceTypePage",
          component: () => import("../views/device/deviceType.vue"),
        },
        {
          name: "客户类型",
          path: "/customerPage",
          component: () => import("../views/customer/index.vue"),
        },
        {
          name: "用户管理",
          path: "/userPage",
          component: () => import("../views/user/index.vue"),
        }
      ],
    },
  ],
});

export default router;
